import { Form } from "@/components/layout/form/form";
import { IMAGES, SELECT, TEXT, CHECKBOX, DATETIMES, TEXTAREA } from "@/utils/enums/type-enums";
import Storage from "@/utils/storage";
import { ACCESS_TOKEN_KEY } from "@/utils/enums/cache-enum";
export const productAddForms: Form[] = [
  {
    label: null,
    card: [
      { line: true },
      { type: TEXT, label: '名称', name: 'names', span: 5, placeholder: '请输入名称' },
      { type: TEXT, label: '编码', name: 'code', span: 5, placeholder: '请输入编码' },
      { line: true },
      {
        type: SELECT, label: '只开通中台', name: 'middle', span: 5, options: [
          { label: '否', value: 0 },
          { label: '是', value: 1 },
        ]
      },
      {
        type: SELECT, label: '是否启用', name: 'status', span: 5, options: [
          { label: '禁用', value: 0 },
          { label: '启用', value: 1 },
        ]
      },
      { line: true },
      { type: TEXT, label: '联系人', name: 'contact', span: 5, placeholder: '请输入联系人' },
      { type: TEXT, label: '联系人电话', name: 'phone', span: 5, placeholder: '请输入联系人电话' },
      { line: true },
      { type: TEXTAREA, label: '备注', name: 'remark', span: 15, style: 'width: 400px', placeholder: '请输入备注' },
    ]
  }
]

export const productAddRules = {
  names: [{ required: true, message: '只能输入4-100个字符', trigger: 'blur', min: 4, max: 100, }],
  code: [{ required: true, message: '只能输入4-10个字符', trigger: 'blur', min: 4, max: 10, }],
  middle: [{ required: true, message: '不能为空', trigger: 'blur', min: 4, max: 10, }],
  status: [{ required: true, message: '只能输入2-20个字符', trigger: 'blur', min: 2, max: 20 }],
  contact: [{ required: true, message: '联系人不能为空', trigger: 'blur' }],
  phone: [{ required: true, message: '联系人电话必须11位', trigger: 'blur', min: 11 }],
}